import * as React from 'react';
import { createStore } from 'redux';
import { Provider } from 'react-redux';
import * as ReactDOM from 'react-dom';
import registerServiceWorker from './registerServiceWorker';
import Hello from './containers/Hello';
import { StoreState } from './types/index';
import { enthusiasm } from './reducers/index';
import './index.css';

/* 
  store 用于存储应用的全局状态的对象
*/
const store = createStore<StoreState>(enthusiasm,{
  languageName:"TypeScript",
  enthusiasmLevel:1,
})

ReactDOM.render(
  /* 
    使用 Provider 来链接我们的属性和容器
  */
  <Provider store={store}> 
    <Hello />
  </Provider>,
  document.getElementById('root') as HTMLElement
);
registerServiceWorker();
